import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Scanner;

/**
 * @author : wushikai
 * <p>
 * date : 2021-04-21
 */
public class PrintColor {




    /**
     *
     *
     *
     *
     * */

    public static void demo(   ) {

        System.out.println("abc中文");

        for (int i = 90; i < 98; i++) {
            System.out.print("\033[" + i + ";0m" + "abc中文" + i + "\033[0m");
            System.out.println();
        }
        for (int i = 30; i < 40; i++) {
            System.out.print("\033[" + i + ";0m" + "abc中文" + i + "\033[0m");
            System.out.println();
        }

        // 1m 粗体，4m 下划线，7m反色
        System.out.println("\033[92;1mabc中文\033[0m");
        System.out.println("日志" + "\033[92;4mabc中文\033[0m");
        System.out.println("日志" + "\033[92;7mabc中文\033[0m");


        Map<String, String> map = new HashMap<>();
        map.put("黑色", "30");
        map.put("红色", "31");
        map.put("绿色", "32");
        map.put("黄色", "33");
        map.put("蓝色", "34");
        map.put("紫红色", "35");
        map.put("青蓝色", "36");
        map.put("白色", "37");


        for (String key : map.keySet()) {

            System.out.println("\033[1;" + map.get(key) + "m" + key + "\033[0m \n");
        }


        System.out.printf("************************* \n");
        System.out.printf("\033[0;30;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[1;30;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[4;30;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[5;30;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[7;30;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[8;30;41m color!!! \033[0m Hello \n");


        System.out.printf("************************* \n");
        System.out.printf("\033[0;30;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;31;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;32;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;33;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;34;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;35;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;36;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;37;41m color!!! \033[0m Hello \n");

        System.out.printf("************************* \n");
        System.out.printf("\033[0;30;40m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;30;41m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;30;42m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;30;43m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;30;44m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;30;45m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;30;46m color!!! \033[0m Hello \n");
        System.out.printf("\033[0;30;47m color!!! \033[0m Hello \n");

    }










    public  static void clear ( ){
        System.out.print("\033[2J");

    }

}
